const { defineConfig } = require("@vue/cli-service");

module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    port: 8088,
    proxy: {
      [process.env["VUE_APP_BASE_API"]]: {
        target: "http://localhost:8089",
        changeOrigin: true,
        pathRewrite: {
          [`^${process.env["VUE_APP_BASE_API"]}`] : "",
        },
      },
    },
    client: {
      //加上这个就好了
      overlay: false,
    },
  },
  chainWebpack: (config) => {
    config.plugin("define").tap((definitions) => {
      Object.assign(definitions[0], {
        __VUE_OPTIONS_API__: "true",
        __VUE_PROD_DEVTOOLS__: "false",
        __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "false",
      });
      return definitions;
    });
  },
});